<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        
        <!-- <h2 :style = "{属性名: 属性值, 属性名: 属性值}">{{message}}</h2> -->
        <!-- 注意:属性值必须加上单引号，否则是以变量形式去解析 -->
        <h2 :style = "{fontSize: finlSize + 'px', backgroundColor: finalBg}">{{message}}</h2>
        <h2 :style = "getStyle()">{{message}}</h2>
    </div>
    <script src= '../js/vue.js'></script>
    <script>
        const app = new Vue({
            el:'#app',
            data:{
                message: '重庆对外经贸学院!!!',
                finlSize: 100,
                finalBg: 'red'
            },
            methods:{
                getStyle() {
                    return {fontSize: this.finlSize + 'px', backgroundColor: this.finalBg};
                }
            }
        })
    </script>
</body>
</html>